package com.example.demo.utils;

import lombok.extern.slf4j.Slf4j;

import java.io.File;
import java.io.IOException;
@Slf4j
public class OpenFileOnDeskTop {
    private OpenFileOnDeskTop(){}

    //打开某个文件

    public static void openFile(File target) throws IOException {
        Runtime rt = Runtime.getRuntime();
        rt.exec("cmd /c start " + target.getAbsoluteFile());
    }
}
